import { IsNumber, IsOptional, IsString } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Transform } from 'class-transformer';

export class DepartmentEntity {
  id?: string;
  @ApiProperty()
  @IsString()
  name: string;

  @ApiPropertyOptional()
  @IsString()
  @IsOptional()
  remark?: string;

  @ApiPropertyOptional()
  @IsString()
  @IsOptional()
  leader?: string | null;

  @ApiPropertyOptional()
  @IsString()
  @IsOptional()
  parentId?: string | null;
  @ApiPropertyOptional()
  @IsOptional()
  @IsNumber()
  weight?: number;
  createdAt?: Date | string;
  updatedAt?: Date | string;
}
